/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: jse2204 - Ex11
 * <p>Powered by webrx On 2022-09-06 09:25:29
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex11 {
    public static void main(String[] args) {
        int s = 500;
        int e = 1000;
        for (int i = s; i <= e; i++) {
            if (i == 1) i = 2;
            if (isNum(i)) System.out.printf("%d ", i);
        }
    }

    /**
    * 功能描述：判断一个数是不是素数，是了返回一个true ,否则返回一个false
    * @param i int
    * @return int
    */
    public static boolean isNum(int i) {
        boolean f = true;
        for (int j = 2; j <= i - 1; j++) {
            if (i % j == 0) {
                f = false;
                break;
            }
        }
        return f;
    }
}
